<?php

namespace App\Http\Controllers\Api\Common;

use App\Http\Controllers\Controller;
use App\Http\Resources\Common\AdvResource;
use App\Models\Common\Adv\Repositories\Interfaces\AdvertisementRepositoryInterface;
use Illuminate\Http\Request;

class AdvController extends Controller
{
    private AdvertisementRepositoryInterface $advRepo;

    public function __construct(AdvertisementRepositoryInterface $repository)
    {
        $this->advRepo = $repository;
    }

    public function list(Request $request)
    {
        return $this->success('', AdvResource::collection($this->advRepo->listAdv()));
    }
}
